package com.itqf.service.impl;

import com.itqf.dao.CategoryDao;
import com.itqf.dao.impl.CategoryDaoImpl;
import com.itqf.pojo.Category;
import com.itqf.service.CategoryService;
import com.itqf.vo.R;

import java.sql.SQLException;
import java.util.List;

/**
 * projectName: gpshop
 *
 * @author: 赵伟风
 * time: 2021/7/22 14:56
 * description:
 */
public class CategoryServiceImpl implements CategoryService {

    /**
     * 查询所有类别的业务方法
     *
     * @return
     */
    @Override
    public R findAll() throws SQLException {
        CategoryDao categoryDao = new CategoryDaoImpl();
        List<Category> categoryList = categoryDao.queryAll();
        //将查询的类别集合装入R
        return R.ok("查询数据成功", categoryList);
    }
}
